/**
 * 
 */
package de.cbf.cam.dsa.facet.sf.helper;

import de.cbf.util.uuidheader.entities.UUIDReference;

/**
 * @author Nebelritter
 *
 */
public class PrerequisiteSfReference extends UUIDReference {
	
	protected Integer fCompensationValue;
	
	public PrerequisiteSfReference() {
		super();
	}
	
	/**
	 * 
	 */
	public PrerequisiteSfReference(UUIDReference reference,int newCompensationValue) {
		super();
		fSavedUuid	= reference.getSavedUuid();
		fSavedName	= reference.getSavedName();
		fSavedClass	= reference.getSavedClass();
		fCompensationValue = newCompensationValue;
	}
	
	/* (non-Javadoc)
	 * @see de.cbf.util.uuidheader.entities.UUIDHeader#init()
	 */
	@Override
	protected void init() {		
		super.init();
		fCompensationValue = 0;
		fSavedName = "<talent>";		
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime
				* result
				+ ((fCompensationValue == null) ? 0 : fCompensationValue
						.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		PrerequisiteSfReference other = (PrerequisiteSfReference) obj;
		if (fCompensationValue == null) {
			if (other.fCompensationValue != null)
				return false;
		} else if (!fCompensationValue.equals(other.fCompensationValue))
			return false;
		return true;
	}
	
	/**
	 * @return the fCompensationValue
	 */
	public Integer getCompensationValue() {
		return fCompensationValue;
	}
	/**
	 * @param fCompensationValue the fCompensationValue to set
	 */
	public void setCompensationValue(Integer compensationValue) {
		this.fCompensationValue = compensationValue;
	}
}
